import request from '@/utils/service'
export default {
    release(essay, access) {
        return request({
            method: "post",
            url: "/user/release",
            data: essay,
            headers: {
                Authorization: "token:" + access, //指定消息格式
            },
        })
    },
    getEssays(userId, limit, page, essayQuery, access) {
        return request({
            method: "post",
            url: `/user/essays/${userId}/${limit}/${page}`,
            data: essayQuery,
            headers: {
                Authorization: "token:" + access, //指定消息格式
            },
        })
    },
    deleteEssays(id, access) {
        return request({
            method: "delete",
            url: `/user/delete/essay`,
            params: {
                id
            },
            headers: {
                Authorization: "token:" + access, //指定消息格式
            },
        })
    },
    getEssayById(id, access) {
        return request({
            method: "get",
            url: `/user/essay`,
            params: {
                id,
            },
            headers: {
                Authorization: "token:" + access, //指定消息格式
            },
        })
    },
    updateEssay(essay, access) {
        return request({
            method: "put",
            url: `/user/essay`,
            data: essay,
            headers: {
                Authorization: "token:" + access, //指定消息格式
            },
        })
    }
}